package com.woshua.mvpmodel.ui;

import java.lang.ref.WeakReference;

/*
* 代理基类
* */
public class BasePresenter<V> {

    /*
    * 考虑强引用
    * */
    private WeakReference<V> mViewRef;

    public void attachView(V view){
        mViewRef=new WeakReference<V>(view);
    }

    public void detachView()
    {
        if(mViewRef!=null)
        {
            mViewRef.clear();
            mViewRef=null;
        }
    }

    public V getView()
    {
        return mViewRef.get();
    }
}
